﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;
using Model;

namespace BLL
{
    public class ClientManage
    {
        public static Client AddClient(Client client)
        {
            return ClientService.AddClient(client);
        }

        public static int GetPersonalInformationIdById(int id)
        {
            return ClientService.GetPersonalInformationIdById(id);
        }
        public static string GetNicknameById(int id)
        {
            int pId = ClientService.GetPersonalInformationIdById(id);
            if (pId == -1)
                return "";
            PersonalInformation pInfo = PersonalInformationManage.GetPersonalInformationById(pId);
            if (pInfo == null)
                return "";
            return pInfo.Nickname;
        }

        public static bool HasId(int userId)
        {
            if (ClientService.GetClientById(userId) != null)
                return true;
            else
                return false;
        }
        public static bool isExistUser(string userName)
        {

            return ClientService.isExistUser(userName);
        }
        public static User CheckPass(string userName, string passWord)
        {
            return ClientService.CheckPass(userName, passWord);
        }

        public static int Count()
        {
            return ClientService.Count();
        }
    }
}
